get random color in flutter

92

    color: Colors.primaries[Random().nextInt(Colors.primaries.length)],
 or 
 	use package random_color 1.0.5
Random random = Random();
Color tempcol = Color.fromRGBO(
    random.nextInt(255),
    random.nextInt(255),
    random.nextInt(255),
    1,
);
//tempcol is random color

Comments

Submit
0 Comments